package com.belazy.basics.auth.constant;

/**
 * @author tangcp
 */
public interface SecurityConstants {
    /**
     * sys_oauth_client_details 字段
     */
    String CLIENT_FIELDS = "client_id, client_secret, resources_ids, scope, authorized_grant_types,"
            + "web_server_redirect_uri, authorities, access_token_validity,"
            + "refresh_token_validity, addition_information, autoapprove";
    /**
     * jdbcClientDetailsService查询sql
     */
    String BASE_FIND_STATEMENT = "SELECT " + CLIENT_FIELDS + " FROM sys_oauth_client_details";

    /**
     * 默认查询语句
     */
    String DEFAULT_FIND_STATEMENT = BASE_FIND_STATEMENT + " ORDER BY client_id";

    /**
     * 根据client_id查询
     */
    String DEFAULT_FIND_STATEMENT_BY_CLIENT_ID = BASE_FIND_STATEMENT + " WHERE client_id = ?";

    String[] OPEN_API = new String[]{
            "/oauth/**",
            "/actuator/**",
            "/auth/**",
            "/v2/api-docs/**",
            "/v3/api-docs/**",
            "/swagger-ui/**"
    };
    /**
     * 静态资源
     **/
    String[] IGNORING_RESOURCES = new String[]{
            "/v3/api-docs",
            "/v2/api-docs",
            "/swagger-resources/configuration/ui",
            "/swagger-resources",
            "/swagger-resources/configuration/security",
            "/swagger-ui.html",
            "/css/**",
            "/js/**",
            "/images/**",
            "/webjars/**",
            "**/favicon.ico",
            "/index"
    };
    String USER_INFO = "user_info";
    String GRANT_TYPE = "grant_type";
    String USERNAME = "username";
    String PASSWORD = "password";
    String SMS_CODE = "smsCode";
    String CLIENT_ID = "client_id";
    String CLIENT_SECRET = "client_secret";
}
